<?php
class Provider extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();

		// load helper
		$this->load->helper('url');
		// $this->load->library('session');

		$this->load->model("Provider_model", '', TRUE);
	}

	public function index()
	{
		$companyId = 1;		
		$data['lstProvider'] = $this->Provider_model->All($companyId);

		$data['mainView'] = 'provider/index';
		$this->load->view('shared/layout', $data);
	}

	public function create()
	{
		$data['mainView'] = 'provider/create';
		$this->load->view('shared/layout', $data);
	}	

	public function create_post()
	{
		$companyId = 1;
		$this->Provider_model->Add($companyId);

		redirect("/provider/index/$companyId");
	}	
}
?>